<?php

require_once 'library/api_client.php';
require_once 'library/iapi_client.php';
require_once 'library/api_exception.php';

abstract class REST_API_Client extends API_Client implements iAPI_Client {
	
	private $config = array();
	protected $valid_methods = array('GET');
	protected $required_params = array();
	
	public function __construct( array $config = array() ) {
		$this->setConfig( $config );
		parent::__construct();
	}
	
	private function setConfig( $config ) {
		$missing_params = array_diff( $this->required_params, array_keys($config) );
		if( count($missing_params )) {
			throw new APIException("The constructor requires the following config params as array keys: " . implode(', ', $missing_params));
		}
		$this->config = $config;
	}
	
	public function getConfig() {
		return $this->config;
	}
	
}